var express = require('express');
var router = express.Router();

// 获取type中暴露的方法
const {addType , getType,deleteType,updateType} = require('../controllers/typeControllers')

router.post('/addType', async function (req, res, next){
    const params = req.body;
    console.log(params);
    const result = await addType(params)
    res.send(result)
})
router.get('/getType',async function ( req ,res ,next){
    const data = await getType()
    res.send(data)
})

router.post('/deleteType', async function(req ,res ,next){
    console.log(111);
    const params  =  req.body;
    const data = await deleteType(params)
    res.send(data)
})

router.post('/updateType', async function (req, res , next){
    const params = req.body;
   const data = await updateType(params)
   res.send(data)
})





module.exports = router;